package gestion.horarios.model.jpa.entities;

import java.io.Serializable;
import javax.persistence.*;

/**
 * The primary key class for the seccion database table.
 * 
 */
@Embeddable
public class SeccionPK implements Serializable {
	//default serial version id, required for serializable classes.
	private static final long serialVersionUID = 1L;
	private int horarioId;
	private int seccionId;

    public SeccionPK() {
    }

	@Column(unique=true, nullable=false)
	public int getHorarioId() {
		return this.horarioId;
	}
	public void setHorarioId(int horarioId) {
		this.horarioId = horarioId;
	}

	@Column(unique=true, nullable=false)
	public int getSeccionId() {
		return this.seccionId;
	}
	public void setSeccionId(int seccionId) {
		this.seccionId = seccionId;
	}

	public boolean equals(Object other) {
		if (this == other) {
			return true;
		}
		if (!(other instanceof SeccionPK)) {
			return false;
		}
		SeccionPK castOther = (SeccionPK)other;
		return 
			(this.horarioId == castOther.horarioId)
			&& (this.seccionId == castOther.seccionId);

    }
    
	public int hashCode() {
		final int prime = 31;
		int hash = 17;
		hash = hash * prime + this.horarioId;
		hash = hash * prime + this.seccionId;
		
		return hash;
    }
}